<!DOCTYPE html>
<html>
<head>
    <title>Promise benchmarks</title>
</head>
<body class="yui3-skin-sam">
    <p><button id="start">Start Benchmarks</button></p>

    <div id="log"></div>

    <applet code="nano" archive="../../../common/vendor/benchmarkjs/nano.jar" style="display: none;"></applet>
    <script src="../../../common/vendor/benchmarkjs/benchmark.js"></script>
    <script src="../../../../build/yui/yui.js"></script>
    <script>

YUI({
    filter: 'raw',
    modules: {
        'promise-benchmark': {
            fullpath: 'promise-benchmark.js',
            requires: ['promise', 'array-extras']
        },

        'test-console': {
            fullpath : '../../../common/tests/assets/test-console.js',
            requires : ['console-filters'],
            skinnable: true
        },

        'skin-sam-test-console': {
            fullpath: '../../../common/tests/assets/test-console.css',
            type    : 'css'
        }
    },

    useBrowserConsole: false
}).use('promise-benchmark', 'node-base', 'test-console', function (Y) {

    var suite = Y.BenchmarkSuite,
        start = Y.one('#start');

    suite.on('start', function () {
        start.set('disabled', true);
        Y.log('Starting benchmarks.');
    });

    suite.on('cycle', function (ev) {
        Y.log(String(ev.target));
    });

    suite.on('complete', function () {
        start.set('disabled', false);
        Y.log('Finished.');
    });

    start.on('click', function () {
        suite.run({async:true});
    });

});
    </script>
</body>
</html>
